﻿using JetBrains.Annotations;
using Volo.Abp;

namespace System.ComponentModel.DataAnnotations;

/// <summary>
/// Names the backing field associated with this property or navigation property.
/// </summary>
[AttributeUsage(AttributeTargets.Property)]
public sealed class BackingFieldAttribute : Attribute
{
    /// <summary>
    /// The name of the backing field.
    /// </summary>
    public string Name
    {
        get;
    }

    /// <summary>
    /// Initializes a new instance of the Microsoft.EntityFrameworkCore.BackingFieldAttribute class.
    /// </summary>
    /// <param name="name">The name of the backing field.</param>
    public BackingFieldAttribute([NotNull] string name)
    {
        Check.NotNullOrEmpty(name, nameof(name));
        Name = name;
    }
}

